package com.gzq.common;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.gzq.common_core.toast.T;
import com.gzq.common_core.utils.KVUtils;
import com.xiaojinzi.component.impl.Router;

import timber.log.Timber;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void skipActivityA(View view) {
        Router.withApi(AppRouterApi.class).skipTest1Activity();
//        T.show("这个是默认的弹窗");
//        UserInfo userInfo = new UserInfo("张丽丽", 18, 45.0, 165f, true,
//                new UserInfo.Education("北京大学", "大一", "李小大"));
//        long l = System.currentTimeMillis();
//        for (int i = 0; i < 10000; i++) {
//            KVUtils.putEntity(i+"", userInfo);
//        }
////        KVUtils.putEntity("save", userInfo);
//        Log.i(TAG, "存入1000次花费的时间: " + (System.currentTimeMillis() - l));
    }

    public void obtainData(View view) {
        long l = System.currentTimeMillis();
        for (int i=0;i<10000;i++){
            UserInfo entity = KVUtils.getEntity("save", UserInfo.class);
        }
        Log.i(TAG, "读取1000次花费的时间： " + (System.currentTimeMillis() - l));
    }
}
